<!DOCTYPE html>
<html>
<head>
    <meta charset="">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" href="../assets/css/layui.css">
    <link rel="stylesheet" href="../assets/css/view.css"/>
    <title></title>
</head>
<body class="layui-view-body">
    <div class="layui-content">
        <div class="layui-row layui-col-space20">
            <div class="layui-col-sm6 layui-col-md3">
                <div class="layui-card">
                    <div class="layui-card-body chart-card">
                        <div class="chart-header">
                            <div class="metawrap">
                                <div class="meta">
                                    <span>用户数量</span>
                                </div>
                                <div class="total" id="userTotal">123456</div>
                            </div>
                        </div>

                        <div class="chart-footer">
                            <div class="field">
                                <span>活跃度</span>
                                <span>321</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-col-sm6 layui-col-md3">
                <div class="layui-card">
                    <div class="layui-card-body chart-card">
                        <div class="chart-header">
                            <div class="metawrap">
                                <div class="meta">
                                    <span>活动数量</span>
                                </div>
                                <div class="total" id="activityTotal">123465</div>
                            </div>
                        </div>

                        <div class="chart-footer">
                            <div class="field">
                                <span>活跃度</span>
                                <span>321</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-col-sm6 layui-col-md3">
                <div class="layui-card">
                    <div class="layui-card-body chart-card">
                        <div class="chart-header">
                            <div class="metawrap">
                                <div class="meta">
                                    <span>总部门数</span>
                                </div>
                                <div class="total" id="departmentTotal">126,560</div>
                            </div>
                        </div>

                        <div class="chart-footer">
                            <div class="field">
                                <span>活跃度</span>
                                <span>321</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-col-sm6 layui-col-md3">
                <div class="layui-card">
                    <div class="layui-card-body chart-card">
                        <div class="chart-header">
                            <div class="metawrap">
                                <div class="meta">
                                    <span>待处理消息</span>
                                </div>
                                <div class="total" id="msgTotal">126,560</div>
                            </div>
                        </div>

                        <div class="chart-footer">
                            <div class="field">
                                <span>日注册量</span>
                                <span>321</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-col-sm12 layui-col-md12">
                <div class="layui-card">
                    <div class="layui-tab layui-tab-brief">
                        <ul class="layui-tab-title">
                            <li class="layui-this">新增数</li>
                            <li>活跃度</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                                dddd
                            </div>
                            <div class="layui-tab-item">
                                ddd
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="../assets/layui.all.js"></script>
    <script>
        layui.use(['form','jquery',"layer"],function(){
            var form = layui.form;
            var $ = layui.jquery;
            var layer = layui.layer;
            
            $.ajax({
                url: '../consoleIndex.do',
                data: {
                    "get":"count"
                },
                dataType: 'json',
                type: 'post',
                success: function(data) {
                    console.log(data);
                    if (data.code == 0){
                        $("#userTotal").text(data.userCount);
                        $("#departmentTotal").text(data.departmentCount);
                        $("#activityTotal").text(data.activityCount);
                    }else{
                        layer.msg('未知错误'+datajson.code);
                    }
                }
            })
        })
    </script>
</body>
</html>